
/**
 * @author Team 29
 * This class documents a patient's billing information in the database.
 *
 */
public class BillingInformation {
	public String billingAddress;
	public String fullName;
	public String creditCardNo;
	public BillingInformation(String fullName, String billingAddress, String creditCardNo){
		this.fullName=fullName;
		this.billingAddress = billingAddress;
		this.creditCardNo = creditCardNo;
	}
	public void setBillingAddress(String address){
		this.billingAddress = address;
	}
	public String getBillingAddress(){
		return this.billingAddress;
	}
	public String toString(){
		return fullName + "\t" + billingAddress + "\t"+ creditCardNo;
	}
	public static BillingInformation fromString(String billingInformation){
		try{
			String[] args = billingInformation.split("\t");
			return new BillingInformation(args[0],args[1],args[2]);
		}
		catch(Exception e){
			Logger.log("ERROR parsing billing information.");
			return null;
		}
	}
}
